package com.zhangdi.demo.provider.rest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.netflix.eureka.EurekaClientConfigBean;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhangdi
 * @version 1.0
 * @date 2022.6.24 14:54
 */

@RestController
@RequestMapping("/test")
public class TestController {
    @Autowired
    EurekaClientConfigBean eurekaClientConfigBean;

    @GetMapping("/server-info")
    public Object getServerUrl(){
        return eurekaClientConfigBean.getServiceUrl();
    }
}
